//
//  AddCommandViewController.h
//  McRemote
//
//  Created by Magic on 2/5/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@class AddCommandViewController;

@protocol AddCommandDelegate <NSObject>

- (void)cancelInAddCommandViewController:(AddCommandViewController *)acc;
- (void)addCommandAtIndex:(NSInteger)index fromViewController:(AddCommandViewController *)acc;
- (void)updateCommandAtIndex:(NSInteger)index fromViewController:(AddCommandViewController *)acc;

@end

@interface AddCommandViewController : UIViewController <UIPickerViewDelegate,UIPickerViewDataSource,UITextFieldDelegate,UIScrollViewDelegate>

@property (nonatomic,weak) IBOutlet UIPickerView *commandPicker;
@property (nonatomic,weak) IBOutlet UILabel *commandLabel;
@property (nonatomic,weak) IBOutlet UIToolbar *flagsToolbar;
@property (nonatomic,weak) IBOutlet UITextField *titleField;
@property (nonatomic,weak) IBOutlet UIScrollView *customIconScrollView;
@property (nonatomic,weak) IBOutlet UILabel *titleLabel;
@property (nonatomic,weak) IBOutlet UILabel *shortcutLabel;
@property (nonatomic,weak) IBOutlet UILabel *iconLabel;

@property (nonatomic) NSInteger newCommandIndex;
@property (nonatomic, weak) id<AddCommandDelegate> delegate;

@property (nonatomic) int32_t flag;
@property (nonatomic) int32_t keyCode;
@property (nonatomic,copy) NSString *title;
@property (nonatomic,copy) NSString *icon;

@property (nonatomic) BOOL toUpdate;

- (IBAction)doneItemClicked;
- (IBAction)cancelItemClicked;

- (IBAction)commandPressed:(id)sender;
- (IBAction)optionPressed:(id)sender;
- (IBAction)controlPressed:(id)sender;
- (IBAction)shiftPressed:(id)sender;

@end
